Pure React
Now just for fun I want to show you how we can write React code without any modern tooling and any build step. So, right inside a regular HTML file. So, this is what I call pure React. And it will show you why the tools that we will talk about next are so helpful. So, to start let’s create our very first project folder. So, right now we have an empty folder. So, let’s create index.HTML. And to scaffold an empty HTML structure in VS Code, we can simply write the exclamation mark, hit enter, and then we have an empty HTML structure. So, let’s give it a title, “Hello React!”. And then here in the body, all I will do for now is to create a div with the ID of “root”. And it could be any ID here of course, but root is the standard for React. And we will place nothing in here.
So, give it a save. And maybe you noticed how prettier automatically formatted the code as I saved it. Okay, so let’s now add React to this file. And the way we do that when we write pure React is by simply including the React library as a script. Now, to get the URL of those scripts, we can actually check out React’s official documentation. So, to do that, let’s head over to our browser and then check out React.dev. So, that’s the official React website, and we will explore it a little bit in a future lecture. But for now, let’s just come here to this learn part. And then right here, let’s select installation.